package edu.uwg.LewisWilliams.android.lab1;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        String userName;
        if(this.getIntent().getExtras()!= null){
        	Bundle transferedData = this.getIntent().getExtras();
        	if(transferedData.getString("userName") != "null"){
        		userName = transferedData.getString("userName");
        	}
        	else{
        		userName = "Stranger";
        	}
        	
        	TextView greeting = (TextView) this.findViewById(R.id.greeting);
        	greeting.setText("Hello " + userName + "!");
        }  
    }
}